package ltd.sshine.tracking.web.validator;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * <p>如果为字符串，不为空字符串</p>
 *
 * @author pzg
 * @since 2022/11/25
 */
@Target( {ElementType.FIELD,ElementType.PARAMETER })
@Retention(RUNTIME)
@Constraint(validatedBy = NotEmptyStringValidator.class)
@Documented
public @interface NotEmptyString {
    String message() default "字符串不能为空";
    String[] fields() default {} ;
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
